<template>
  <div class="layout">
    <div class="search" @click="handleSearch">
      <!-- <u-icon name="search"></u-icon> -->
      <!-- {{ res.list[0].title }} -->
        请输入关键词搜索商品
    </div>
    <div style="position: absolute;right: 32rpx;top:0;height: 100%;display: flex;justify-content: center;align-items: center" slot="right" open-type="contact">
      <div  class="navbar-right" @click=" handleSearch" >
        <image style="width:36rpx;height:36rpx;" src="@/static/img/search.png"></image>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  title:"搜索栏",
  props: ["res","storeId"],
  methods: {
    linkMsgDetail(){
      uni.navigateTo({
        url:`/pages/tabbar/home/title`
      })
    },
 
    handleSearch() {
      if(this.storeId){
        uni.navigateTo({
        url: `/pages/navigation/search/searchPage?storeId=${this.storeId}`,
      });
      }else{
         uni.navigateTo({
        url: `/pages/navigation/search/searchPage`,
      });
      }
      
    },
  },
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";

.search {
  height: 70rpx;
  border-radius: 39rpx;
  display: flex;
  align-items: center;
  background: #fff;
  border: 4rpx solid #212121;
  padding-left: 40rpx;
  box-sizing: border-box;
}

.layout {
  padding: 0 24rpx;
  position: relative;
}
.navbar-right{

  width: 92rpx;
  height: 54rpx;
  border-radius: 39rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #212121;
}
</style>
